home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / comm / 110a115a.zip / SCRIPTS.ZIP / CAPWATCH.SLT < prev    next >
Text File  |  1995-12-21  |  3KB  |  70 lines

  1. /****************************************************************/
  2. /*                                                              */
  3. /*  Demo of how to use capture files from SALT, as well as how  */
  4. /*  to access some internal script variables for color, etc...  */
  5. /*                                                              */
  6. /*                   Copyright 1995 deltaComm Development, Inc. */
  7. /*                                                              */
  8. /****************************************************************/
  9.  
  10. main()
  11. {
  12.  int ff, a;
  13.  str dat[16];
  14.  
  15.  capture("captfile.cap");                   // Open capture file
  16.  
  17.  msgbox("", "Closing capture file will exit Telix", 0);
  18.  
  19.  while ((capture_stat > 0))                 // While the capture log is open
  20.    terminal();                              // do terminal emulation....
  21.  
  22.                                             // as soon as capture is closed...
  23.  ff=_back_color;                            // let's monkey with the colors!
  24.  _back_color=_fore_color;                   // Here, we invert the video!
  25.  _fore_color=ff;                            // But remember, color changes
  26.  update_term();                             //    don't happen until we do this
  27.  
  28.  while (cinp_cnt())                         // While there are chars waiting to
  29.     cgetc();                                // be received, go get them.  This
  30.                                             // is just a way to clear buffers
  31.  
  32.  if (carrier())                             // If we're online right now, then
  33.    {                                        // tell us a little bit about
  34.     printsc("Baud rate: ");                 // yourself, Ms. Remote....
  35.     prints(get_baud());
  36.     printsc("Data Bit: ");                  // Sure, Chuck, I have 8 bits...
  37.     prints(get_datab());
  38.     printsc("Parity: ");
  39.     prints(get_parity());
  40.     printsc("Port: ");
  41.     prints(get_port());
  42.     printsc("Stop Bit: ");
  43.     prints(get_stopb());
  44.     hangup();                               // Sorry, no love connection
  45.    }
  46.  
  47.  if (filefind("captfile.cap", a))           // Find our capture file
  48.   {
  49.    ff=fopen("captfile.cap", "r");           // Open file to get a handle on it
  50.    if (ferror(ff)) fclearerr(ff);           // Clear any errors with the file
  51.  
  52.    printsc("file attribute code: ");        // Display various file variables
  53.    printn(fileattr("captfile.cap"));
  54.    printsc("File size: ");
  55.    printn(filesize("captfile.cap"));
  56.    date(filetime("captfile.cap"), dat);
  57.    prints(dat);
  58.    fclose(ff);                              // Close and release file
  59.   }
  60.  
  61.  if (usage_stat())                          // Check if usage log open
  62.   {
  63.    ustamp("Telix stopped by 'Capture Watcher' script.", 1, 0);
  64.    usagelog("*CLOSE*");
  65.   }
  66.  
  67.  printer(0);                                // Deactivate printer log
  68.  exittelix(0, 1);                           // Close Telix
  69. }
  70.